<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>TEST</title>
</head>
<body>
<p class="example" style="color: gray;">

</p>
<script>

        var example = document.getElementsByClassName("example")[0];
        alert(example.style.background);

</script>
</body>
</html>